const router = require('koa-router')();


// 手机菜单列表
router.post('/user/getMenuListV4', async ctx => {
    let list = [
        // {id: 1, pid: 0,title: '客户拜访',routeName: 'bf',path: 'bf',component: 'bf/bf',pageName:'',tag:'',addRoute: '',},
        // {id: 2, pid: 0,title: '拜访记录',routeName: 'bfMy',path: 'bfMy',component: 'bf/bfMy',pageName:'',tag:'',addRoute: '',},
        // {id: 3, pid: 0,title: '拜访轨迹',routeName: 'bfGj',path: 'bfGj',component: 'bf/bfGj',pageName:'',tag:'',addRoute: '',},
        // {id: 4, pid: 0,title: '新增客户',routeName: 'contactAdd',path: 'contactAdd',component: 'contact/contactAdd',pageName:'',tag:'',addRoute: '',},
        // {id: 5, pid: 0,title: '我的客户',routeName: 'contactMy',path: 'contactMy',component: 'contact/contactMy',pageName:'',tag:'',addRoute: '',},
        // {id: 6, pid: 0,title: '拜访首页',routeName: 'bfHome',path: 'contactMy',component: 'contact/contactMy',pageName:'',tag:'',addRoute: '',},
        // {id: 7, pid: 0,title: '新增收款',routeName: 'addSk',path: 'addSk',component: 'sk/addSk',pageName:'',tag:'',addRoute: '',},
        // {id: 8, pid: 0,title: '交款核对',routeName: 'jkhd',path: 'jkhd',component: 'sk/jkhd',pageName:'',tag:'',addRoute: '',},
        // {id: 9, pid: 0,title: '收款记录',routeName: 'skJl',path: 'skJl',component: 'sk/skJl',pageName:'',tag:'',addRoute: '',},
        // {id: 10, pid: 0,title: '收款统计',routeName: 'skTj',path: 'skTj',component: 'sk/skTj',pageName:'',tag:'',addRoute: '',},
        // {id: 11, pid: 0,title: '票据筛选',routeName: 'billFind',path: 'billFind',component: 'sk/billFind',pageName:'',tag:'',addRoute: '',},
        // {id: 12, pid: 0,title: '领单收款',routeName: 'appLdsk',path: 'appLdsk',component: 'sk/appLdsk',pageName:'',tag:'',addRoute: '',},
        // {id: 13, pid: 0,title: '应收查询',routeName: 'appYs',path: 'appYs',component: 'sk/appYs',pageName:'',tag:'',addRoute: '',},
        // {id: 14, pid: 0,title: '收款明细',routeName: 'skDetail',path: 'skDetail',component: 'sk/skDetail',pageName:'',tag:'',addRoute: '',},
        // {id: 15, pid: 0,title: '商品管理',routeName: 'goods',path: 'goods',component: 'stock/goods',pageName:'',tag:'',addRoute: '',},
        {id: 1, pid: 0,title: '库存',routeName: 'kc',path: 'kc',component: 'stock/kc',pageName:'',tag:'',addRoute: '',},
        {id: 2, pid: 0,title: '客户',routeName: 'goods',path: 'goods',component: 'stock/goods',pageName:'',tag:'',addRoute: '',},
        {id: 3, pid: 0,title: '商品管理',routeName: 'goods',path: 'goods',component: 'stock/goods',pageName:'',tag:'',addRoute: '',},
        {id: 4, pid: 0,title: '新增商品',routeName: 'addGood',path: 'addGood',component: 'stock/addGood',pageName:'',tag:'',addRoute: '',},
        {id: 5, pid: 0,title: '入库',routeName: 'rk',path: 'rk',component: 'stock/rk',pageName:'',tag:'',addRoute: '',},
        {id: 6, pid: 0,title: '零售',routeName: 'ls',path: 'ls',component: 'stock/ls',pageName:'',tag:'',addRoute: '',},
        {id: 7, pid: 0,title: '销售',routeName: 'xs',path: 'xs',component: 'stock/xs',pageName:'',tag:'',addRoute: '',},
        {id: 8, pid: 0,title: '销售-商品',routeName: 'xsGood',path: 'xsGood',component: 'stock/xs_good',pageName:'',tag:'',addRoute: '',},
        {id: 9, pid: 0,title: '购物车',routeName: 'submits',path: 'submits',component: 'stock/cart/submits',pageName:'',tag:'',addRoute: '',},
        {id: 10, pid: 0,title: '销售记录',routeName: 'xslist',path: 'xslist',component: 'sale/list',pageName:'',tag:'',addRoute: '',},
        {id: 11, pid: 0,title: '修改密码',routeName: 'altpwd',path: 'altpwd',component: 'userCenter/altpwd',pageName:'',tag:'',addRoute: '',},
        {id: 12, pid: 0,title: '票据明细',routeName: 'xsdetail',path: 'xsdetail',component: 'sale/detail',pageName:'',tag:'',addRoute: '',},
        {id: 13, pid: 0,title: '销售统计',routeName: 'xsgp',path: 'xsgp',component: 'sale/xsgp',pageName:'',tag:'',addRoute: '',},
        {id: 14, pid: 0,title: '待收款',routeName: 'dsk',path: 'dsk',component: 'sale/dsk',pageName:'',tag:'',addRoute: '',},
        {id: 15, pid: 0,title: '拜访记录',routeName: 'bfjl',path: 'bfjl',component: 'bf/bfjl',pageName:'',tag:'',addRoute: '',},
        {id: 16, pid: 0,title: '终端拜访',routeName: 'zdbf',path: 'zdbf',component: 'bf/zdbf',pageName:'',tag:'',addRoute: '',},
        {id: 17, pid: 0,title: '选择终端',routeName: 'xzzd',path: 'xzzd',component: 'bf/contact',pageName:'',tag:'',addRoute: '',},
    ]
    return ctx.suc('', list)
})
// 保存常用菜单
// 手机工作台菜单
// 手机要显示的菜单
router.post('/menu/getAppMenu', async ctx => {
    let ret = [
        {
            title: '业务', color: '#1e9fff', list: [
                // {title: '入库', route: 'rk', src: 'https://download.sanzhiyun.cn/app/pic/入库.png'},
                // {title: '零售', route: 'ls', src: 'https://download.sanzhiyun.cn/app/pic/零售.png'},
                {title: '销售', route: 'xs', src: 'https://download.sanzhiyun.cn/app/pic/销售1.png'},
                {title: '销售记录', route: 'xslist', src: 'https://download.sanzhiyun.cn/app/pic/销售记录.png'},
                {title: '销售统计', route: 'xsgp', src: 'https://download.sanzhiyun.cn/app/pic/销售统计.png'},
                {title: '销售明细', route: 'xsmx', src: 'https://download.sanzhiyun.cn/app/pic/Cupones.png'},
                {title: '派单收款', route: 'pdsk', src: 'https://download.sanzhiyun.cn/app/pic/收款认领.png'},
                {title: '终端拜访', route: 'zdbf', src: 'https://download.sanzhiyun.cn/app/pic/终端拜访.png'},
            ]
        },
        // {
        //     title: '收款', color: '#1e9fff', list: [
        //         {title: '待收款', route: 'dsk', src: 'https://download.sanzhiyun.cn/app/pic/收款.png'},
        //     ]
        // },
        {
            title: '资料', color: '#F56C6C', list: [
                {title: '终端管理', route: 'zdgl', src: 'https://download.sanzhiyun.cn/app/pic/终端.png'},
                {title: '商品管理', route: 'goods', src: 'https://download.sanzhiyun.cn/app/pic/商品.png'},
            ]
        },
    ]
    return ctx.suc('', ret)
})


module.exports = router;
